package com.itheima.test5;

public class StudentTest {
    public static void main(String[] args) {
        //创建对象
        //调用的空参构造

        //创建对象时即可初始化(可以不用set了)
        Student s = new Student("张三",23);

        System.out.println(s.getName());
        System.out.println(s.getAge());

        //其实用了有参处理后,可以不用set了.以下是set用法
        Student s2 = new Student();
        s2.setName("小诗诗");
        s2.setAge(18);
        System.out.println(s2.getName());
        System.out.println(s2.getAge());
    }
}
